AI Verified

Name

WordPress Dark Mode Dashboard

About

WordPress Dark Mode Dashboard

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

What You Will Learn: – How to change your WordPress dashboard to dark mode. – Customizing hover colours and other elements within the dashboard. – Using admin colour schemes to complement the dark mode. – Implementing the dark mode using a PHP code snippet with a plugin like Fluent Snippets. – Understanding the CSS properties such as ‘filter’, ‘invert’, and ‘hue-rotate’ to customize colours. – How to modify links and text colours to fit your preferences. Before You Start: This is not a perfect solution but a starting point for those who want to experiment and tweak their WordPress dashboard’s appearance. Remember to choose an admin colour scheme that suits the dark mode from your user profile settings. Step-by-Step Guide: 1. Install a code snippet plugin like Fluent Snippets (free) or any other that allows custom PHP code to be added. 2. Use the provided PHP code snippet to create a custom function and add it to the admin area of WordPress. 3. Customize the CSS within the snippet to change the look of your dashboard, including links, text, and background colours. Key Points: – The code snippet only affects the admin area and won’t change your website’s front end. – The CSS ‘invert’ property creates the dark mode effect, with adjustments made for certain elements to maintain readability. – You can fully customize the CSS to your liking, including the colours of links and hover effects. Final Thoughts: Have fun with this tutorial, and feel free to modify the code to suit your own style. If you run into any issues, you can easily disable the code snippet to revert any changes. If you make any cool modifications or have suggestions, please share them in the comments section below. Let’s see how creative you can get with your WordPress dashboard!

Link for further information:

The author has provided the following URL that may be helpful to setting up or using this snippet:

https://youtu.be/9B-Y7L4NhgM?si=_z7H2w3v5diKEmUO

Codevault

justin's vault

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.4

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Snippet Source:

https://wptuts.co.uk/wordpress-dark-mode-dashboard-with-free-code-snippet/

History

Last modified:

19/03/2024

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

WordPress Dark Mode Dashboard

 
                    
1function applyCustomStyles() {
2 echo '
3 <style>
4 
5 /* Change link colour to white */
6 #wpbody-content a {
7 filter: invert(1) hue-rotate(180deg) saturate(10);
8 color: white !important;
9 }
10 
11 /* Change link colour to yellow */
12 #wpbody-content a:hover {
13 filter: invert(1) hue-rotate(180deg) saturate(10);
14 color: red !important;
15 }
16 
17 /* Styling for primary content area. */
18 .block-editor-page .editor-styles-wrapper {
19 color: lightgray;
20 background: #262626;
21 }
22 
23 /* Base styling adjustments. */
24 .wp-admin {
25 background-color: #262626;
26 }
27 
28 /* Image display corrections. */
29 .wp-admin #wpbody img {
30 filter: invert(1) hue-rotate(-180deg);
31 background: white;
32 }
33 
34 /* Enhancements for hyperlink visuals. */
35 .block-editor-page .editor-styles-wrapper a {
36 filter: invert(0.85) hue-rotate(185deg);
37 }
38 
39 /* Filter reset for specific editor sections. */
40 .block-editor-page #wpbody {
41 filter: unset;
42 }
43 
44 /* Adjustments for the main body appearance. */
45 .wp-admin #wpbody {
46 filter: invert(0.85) hue-rotate(185deg);
47 }
48 
49 /* Sidebar appearance customization. */
50 .block-editor-page .interface-interface-skeleton__sidebar,
51 .block-editor-page .interface-interface-skeleton__secondary-sidebar {
52 filter: invert(0.85) hue-rotate(185deg);
53 }
54 
55 /* Configuration for top navigation bar. */
56 .block-editor-page .interface-interface-skeleton__header {
57 filter: invert(0.85) hue-rotate(185deg);
58 }
59 
60 /* Primary action button styling. */
61 .block-editor-page .is-primary {
62 color: black !important;
63 }
64 
65 /* Lower section layout adjustments. */
66 .block-editor-page .edit-post-layout__metaboxes {
67 border-top: 0px;
68 background-color: #262626;
69 }
70 
71 /* Reset various button BG colours */
72 .wrap .add-new-h2, .wrap .add-new-h2:active, .wrap .page-title-action, .wrap .page-title-action:active {
73 background:#f6f7f700;
74 }
75 
76 </style>';
77}
78add_action('admin_head', 'applyCustomStyles');

0

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Company Details

Added: 8 months ago

Last Updated: 8 months ago

WordPress Admin

AI Verified

0

Disable WP Address and Site URL fields in admin

Added: 2 years ago

Last Updated: 1 year ago

Block clients from touching the WP address and Site URL in the admin settings

WordPress Admin

AI Verified

0

Change admin email without sending verification emails

Added: 2 months ago

Last Updated: 2 months ago

This code snippet allows you to change the admin email setting in WordPress without requiring outbound email verification. This functionality was removed in WordPress v4.9, and this snippet restores i...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

3

Default featured image

Added: 2 years ago

Last Updated: 2 months ago

This code defines a function named default_post_metadata__thumbnail_id that modifies the value of the _thumbnail_id metadata field for a post. The function takes five arguments: $value: The current...

WordPress Admin

AI Verified

2

Completely Disable Comments

Added: 1 year ago

Last Updated: 6 months ago

This will disable comments on the entire site

WordPress Admin

AI Verified

1

Disable Automatic Updates

Added: 1 year ago

Last Updated: 11 months ago

This will disable automatic updates